{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6041ac70",
   "metadata": {},
   "outputs": [],
   "source": [
    "'''\n",
    "数据集和数据加载器\n",
    "处理数据样本的代码可能会变得混乱且难以维护；理想情况下，我们希望我们的数据集代码与我们的模型训练代码分离，以获得更好的可读性和模块化。\n",
    "PyTorch提供了两个数据原语：torch.utils.data.DataLoader和torch.utils.data.Dataset ，让您使用预加载数据集，以及您自己的数据。 \n",
    "Dataset存储样本及其相应的标签，并DataLoader在周围包装一个可迭代对象Dataset，以便轻松访问样本。\n",
    "\n",
    "PyTorch 域库提供了许多预加载的数据集（例如 FashionMNIST），它们子类化torch.utils.data.Dataset并实现特定于特定数据的功能。\n",
    "它们可用于对模型进行原型设计和基准测试。您可以在此处找到它们：图像数据集、 文本数据集和 音频数据集\n",
    "\n",
    "加载数据集\n",
    "以下是如何从 TorchVision加载Fashion-MNIST数据集的示例。Fashion-MNIST 是 Zalando 的文章图像数据集，由 60,000 个训练示例和 10,000 个测试示例组成。每个示例都包含一个 28×28 灰度图像和来自 10 个类别之一的相关标签。\n",
    "\n",
    "我们使用以下参数加载FashionMNIST 数据集：\n",
    "root 是存储训练/测试数据的路径，\n",
    "train 指定训练或测试数据集，\n",
    "download=True 如果数据不可用，则从 Internet 下载数据root。\n",
    "transform并target_transform指定特征和标签转换\n",
    "'''"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "dfb4d63e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Downloading http://fashion-mnist.s3-website.eu-central-1.amazonaws.com/train-images-idx3-ubyte.gz to data\\FashionMNIST\\raw\\train-images-idx3-ubyte.gz\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|█████████▉| 26312704/26421880 [00:08<00:00, 6114389.15it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Extracting data\\FashionMNIST\\raw\\train-images-idx3-ubyte.gz to data\\FashionMNIST\\raw\n",
      "Downloading http://fashion-mnist.s3-website.eu-central-1.amazonaws.com/train-labels-idx1-ubyte.gz to data\\FashionMNIST\\raw\\train-labels-idx1-ubyte.gz\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      "0it [00:00, ?it/s]\u001b[A\n",
      "  0%|          | 0/29515 [00:00<?, ?it/s]\u001b[A\n",
      " 56%|█████▌    | 16384/29515 [00:00<00:00, 56528.67it/s]\u001b[A"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Extracting data\\FashionMNIST\\raw\\train-labels-idx1-ubyte.gz to data\\FashionMNIST\\raw\n",
      "Downloading http://fashion-mnist.s3-website.eu-central-1.amazonaws.com/t10k-images-idx3-ubyte.gz to data\\FashionMNIST\\raw\\t10k-images-idx3-ubyte.gz\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "0it [00:00, ?it/s]\u001b[A\u001b[A\n",
      "\n",
      "  0%|          | 0/4422102 [00:00<?, ?it/s]\u001b[A\u001b[A\n",
      "\n",
      "  0%|          | 16384/4422102 [00:01<01:24, 52374.86it/s]\u001b[A\u001b[A\n",
      "\n",
      "  1%|          | 49152/4422102 [00:01<00:52, 83805.94it/s]\u001b[A\u001b[A\n",
      "\n",
      "  2%|▏         | 106496/4422102 [00:01<00:33, 129816.42it/s]\u001b[A\u001b[A\n",
      "\n",
      "  5%|▌         | 221184/4422102 [00:01<00:18, 223704.56it/s]\u001b[A\u001b[A\n",
      "\n",
      " 10%|█         | 450560/4422102 [00:02<00:09, 405142.68it/s]\u001b[A\u001b[A\n",
      "\n",
      " 20%|██        | 901120/4422102 [00:02<00:03, 945639.01it/s]\u001b[A\u001b[A\n",
      "\n",
      " 24%|██▎       | 1048576/4422102 [00:02<00:03, 876604.02it/s]\u001b[A\u001b[A\n",
      "\n",
      " 39%|███▉      | 1720320/4422102 [00:02<00:01, 1834861.23it/s]\u001b[A\u001b[A\n",
      "\n",
      " 46%|████▌     | 2015232/4422102 [00:02<00:01, 1648971.86it/s]\u001b[A\u001b[A\n",
      "\n",
      " 61%|██████    | 2703360/4422102 [00:03<00:00, 2583969.18it/s]\u001b[A\u001b[A\n",
      "\n",
      " 75%|███████▌  | 3325952/4422102 [00:03<00:00, 3319959.49it/s]\u001b[A\u001b[A\n",
      "\n",
      " 85%|████████▌ | 3776512/4422102 [00:03<00:00, 3198628.87it/s]\u001b[A\u001b[A\n",
      "\n",
      "4423680it [00:03, 3894061.75it/s]                             \u001b[A\u001b[A"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Extracting data\\FashionMNIST\\raw\\t10k-images-idx3-ubyte.gz to data\\FashionMNIST\\raw\n",
      "Downloading http://fashion-mnist.s3-website.eu-central-1.amazonaws.com/t10k-labels-idx1-ubyte.gz to data\\FashionMNIST\\raw\\t10k-labels-idx1-ubyte.gz\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "0it [00:00, ?it/s]\u001b[A\u001b[A\u001b[A\n",
      "\n",
      "\n",
      "32768it [00:05, 6273.77it/s]                            \n",
      "4423680it [00:04, 1041949.93it/s]\n",
      "\u001b[A\u001b[A\u001b[A"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Extracting data\\FashionMNIST\\raw\\t10k-labels-idx1-ubyte.gz to data\\FashionMNIST\\raw\n",
      "Processing...\n",
      "Done!\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\r",
      "26427392it [00:19, 6114389.15it/s]                              "
     ]
    }
   ],
   "source": [
    "import torch\n",
    "from torch.utils.data import Dataset\n",
    "from torchvision import datasets\n",
    "from torchvision.transforms import ToTensor\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "\n",
    "training_data = datasets.FashionMNIST(\n",
    "    root=\"data\",\n",
    "    train=True,#训练集\n",
    "    download=True,\n",
    "    transform=ToTensor()\n",
    ")\n",
    "\n",
    "test_data = datasets.FashionMNIST(\n",
    "    root=\"data\",\n",
    "    train=False,#测试集\n",
    "    download=True,\n",
    "    transform=ToTensor()\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "4183174e",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "26427392it [20:10, 21827.27it/s]  \n",
      "8192it [19:57,  6.84it/s]               \n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAckAAAHRCAYAAAABukKHAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAABRqElEQVR4nO3dd5xU5fU/8M+xgCJVeu8KSBMLioAgdkRN7LFgEhKBqD+NJpqYGEuMJSHGEkuUqLFFY2zYokZQAUFRUBFB6UjvXUF8fn/M8M0+55y7cxmW3Z3dz/v14qXn2bN37szcuc/eec59HgkhgIiIiKzdynoHiIiIyit2kkRERAnYSRIRESVgJ0lERJSAnSQREVECdpJEREQJ2EkSlRIRuVBExhaJg4i0K8t9IqLiVcpOUkTmishmEdkgIqtF5GURaV7W+0WFQx1DS0XkYRGpXtb7RZVTkeNxvYisEZHxIjJURCrlOb4kVeYXcFAIoTqAxgCWArirjPeHCs/2Y6gHgIMB/KaM96dYIrJHWe8D7VKDQgg1ALQEcAuAqwCM9BJFZPfS3LFCVpk7SQBACOFrAM8A6AQAIjJQRCaLyDoRWSAi1xXNF5ELRGSeiKwUkd9m/4I7ugx2ncqJEMJCAK8C6Jz9CvX/OiMRGSMiQ3JtQ0Rqicg/RGR59vj6jYjsJiJVs1cGnYvk1s9eNTTIxieJyJQiVxBdi+TOFZGrROQTABvZUVZ8IYS1IYQXAZwFYLCIdM5+03GviLwiIhsB9BeRJiLy7+wxN0dELt2+D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ZxVWrVjU5U6dOzbmdI488MopHjhxpcurVq2faTj755CgeN26cyWnXrl0UN2jQwOToz4L3+ffGMvX4/B133GFyOCa5a1199dWmrW7dulGsj2+PPpYBO/4I2HNN8+bNTY6eOKVVq1YmR0+c8vTTT5ucssYxSSIiojywkyQiIkrATpKIiCgBO0kiIqIExa4CUqjymUzgzDPPNG0//elPc/6eV8ChH+/bb781OcOHD4/iO++80+ToVSWAkivUKakii0KjCxQaNWpkcrwb7PWKGps3bzY5erWFGTNmmJz//ve/Ufy9733P5HzzzTem7Z133oliPakFYAsrvv76a5OT5n32Pi8tWrTI+XuV5RgqK126dDFtCxYsiGLvvatZs2bObXtFOXpb3vGkC3c+/fRTk6OP1bJe3WhH8UqSiIgoATtJIiKiBOwkiYiIElTIMUn9nbf3PX3Xrl2j+N133zU53hiLntjaGz/KtT+A/Q7+2WefNTkHHXSQaZs0aVIUexMl6G1X1rEib2yxe/fuOX9v06ZNpk2/794E5xs2bIjiDh06mJzatWtHsXfzt3e86EnPvXGmjRs3RvE+++xjcrznliZHj516k/bTrqXHxQE7Qb4eowTsceFtx5tgIM15VI9JeucjfY70jsv169ebtvKCV5JEREQJ2EkSERElYCdJRESUgJ0kERFRggpZuKNvlPfo1Ri8whmPLoLxHiufQpnp06ebttNPP9206cIdT5rHrwzFPJ06dTJtNWrUiOK1a9eaHK8oRr/PXnGLLlrQBRMA0LBhwyjWqzgA/o3VugjJu7FbF1p4RWVp3nfv97xiIipdc+fONW1DhgyJ4lWrVpkcPSmJ/gwAfuGOLvDxjvk1a9ZEsfeZ05+LatWqmRwW7hARERUgdpJEREQJ2EkSEREl2OkxyZIakyvJx08zWa6esNmbqNyjn1ua55pmjNT7nr569eo5fy/Ncy3r96is9O3b17SluUHau9l53bp1UewdL3oie+911+M63s3X3u/piQo8er/THHfe8/Aea999943i+vXrm5zly5fnfDxKr1mzZlHsjZXrNm/iez3hgB5HBPzPgZ74Qk8cANiJ0Xv37m1ypk6dGsXemOjSpUtNW3nBK0kiIqIE7CSJiIgSsJMkIiJKwE6SiIgowU4X7pTHAhBdzOIVMOibs9PezOqt/pDr8b3f0QPlepAesMUSHu/1T1OwURkccMABOXPSFs7o19l7T9OsvqILh9J+fnSBjVdoodu8G8T143nFGN7z19vyVlN54403TBvlr169elGsC3AA4I477ohib4WPWrVqRbEuQgP8ySL0saG3AwAzZsyIYm/Cg/POOy/nPpZnvJIkIiJKwE6SiIgoATtJIiKiBOwkiYiIEpTrVUDSFFB4hRd65hOPnp0k7WwhW7ZsSZW3o/vjrUahV4wA7Cw83uwousjC2+d8C0gKyX777WfadHGNV7DgvV+62GDvvfc2OXpb3kod+phOOxuSbvOKcvRnwZs5SOd4j+/NfqKfmzebEQt3SpaeFcybleuVV16JYl0kAwCLFi2KYl20CPjHql7FxpspZ/HixVHszeDUs2fPKPbO2eUZrySJiIgSsJMkIiJKwE6SiIgoQbkZk8x3pYo0431HHHGEadu8eXMU33zzzSYnzbiP9/26vtHcG/eaMmVKFHfo0MHkeDfv6ln/vTHJNOOmaVYPKXStW7c2bfq18SZsuO2220xbo0aNonjw4MEmR6+usCtXX/G2/c0330SxXsUBAG699dYo7tevn8nxVpfXExV069YtxV7SztDH3JIlS0yOnhigffv2JmfevHlR7J3XvMkpNO9cp2skPvroI5Ojx1K98fzyjFeSRERECdhJEhERJWAnSURElICdJBERUYIyK9zRN7SmvUm/ZcuWUTxixIicOdOnTzc5+uZZb8UIb5/0zPjeKgq6zVsxYsCAAVHsFfd4N3VfdtllUdyxY0eT87e//S2KR40aZXL0zfG66KMi0McBkK645umnnzZtukDMK9zRr6FXoKALJLzHT7OKi1cAlKb44uqrr47ic845x+Q88cQTpm316tVRfMghh+R8LNo5unDHm3Bk1qxZUexNFKB5hTveeUwfT15OmzZtonj8+PEmZ9OmTVGsiw/LO15JEhERJWAnSURElICdJBERUYIyG5NMMwnAxRdfbNr0JLvepMr6u3Q9wS4AHHTQQVE8depUk/P+++/n3MeZM2eaNv3cvLEi/Tz0d/uAf6O7HouaM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1r2vSMQ7oYAwBatGiR8/EpPV0E463wkWZWKZ3jFc6kWQXEy9EFXbpICLArN+VbJFRWeCVJRESUgJ0kERFRAnaSRERECXZ4TFKPyaW5YXnAgAGm7c0334zihx56yOS8+OKLpk3Pel+rVi2To8cpp0yZYnJWr14dxe3btzc53iQEeizRGyfQr4m3j3qcdsWKFSbnnXfeMW36+VevXt3k6EkIvPEjPX6V743n5UmaFWL08/zggw9Sbbtnz55RrI8fwJ98ojSlGZO89NJLo3j48OEmZ9WqVaYtzfHh1QdQ/lq1ahXFNWrUMDkLFizImaPPUWlyADt26Y0l6nFTb+UmneNNblKe8UqSiIgoATtJIiKiBOwkiYiIErCTJCIiSrBLVgHRqwF4q1noApgvvvjC5OgbVQF7Y7xXuKI1aNDAtK1bty6KP/vsM5PTtWtX06b326Nv3vUGxXWRg54kAACaN29u2nQBhZ64IM3+APbGYG/lh0Kjj4U0K5u88soreT2WV7ijCyJ25coqXlGSfp+9fRw2bFgUe4U7kyZNMm19+/bNuU8VofirPNEFfzNmzDA5urjG+6zrghuvcMebYCDNah363O4V9+iJSvTkAuUdrySJiIgSsJMkIiJKwE6SiIgowQ6PServqb3Js7t37x7FM2fOzLld78b9r776yrTpsTxv0l1986o3jrj//vtHsTeesnbtWn9nczy+HhfwbvLWOd4YU5obfD1pbirXj++NfxaafCYYHzVqlGk7//zzc/6eN8G4frx8Jzj36G15x6tuy3ciae81+fnPfx7F3thXmvFxSq9///45c1577bUo9s4P+n1Jk5NWw4YNo9g7Z5522ml5bbu84JUkERFRAnaSRERECdhJEhERJWAnSURElGCXLFvQpEmTKP78889Njl5VYc6cOSbHKw7QxSzeygNewYumi1u8FbXTrMTt5eT6He/xvcF0rzgkzSos+rnsypvaC93KlStN2wknnJDz97xjU78X3vuX7w33aYqAdOFSmgIuXWQHAGPGjMn5e97z8Ir4aNfSBTdpzhneucY7nnWbd67TK3qkOR8WGl5JEhERJWAnSURElICdJBERUYIdHpNMM86hxwS98T696vbbb79tcgYOHGjaF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+smWIxWqk0TmjewJYKKIbETm4JkK4AoA1wPoAWAtgJcBPJt2oyGEV5H5SuMtADOz/y1qOIAbRGQ9gGuR6VSJijsed9ZbAD4DsEREVpTA9qj825nj6QJkbhmZBmA1gGeQGbMEUp4bQwhrkClePEFEbgwhTALwEwB3Z7c5E9lix4pEQij4q2EiIqJdoqJdSRIREZUYdpJEREQJ2EkSERElYCdJRESUoNi59ESEVT2VWAihTO71LOvjLnlmuP/Jt+CtcePGUdyyZUuTs2nTJtN29tlnR/Gzz9oCxEmTJuW1T9puu9m/nb/77rsS2XYaZXHclfUxR2WruGOOV5JEREQJ2EkSERElYCdJRESUgJ0kERFRgmJn3OFgduVWWQt3SopXAPTvf/87imvUsNNcfv3116atdu3aUfzf//7X5Kxfvz6KR4wYkWY3U9HPZVfO1MXCHSptLNwhIiLKAztJIiKiBOwkiYiIEhQ7mQARZegxwTVr1picwYMHR/G9995rcvQ4Ydu2bU1Ohw4dTJu+mX/z5s0m5/jjj4/iBg0amJyrrroqitNOHMDVgqiy4pUkERFRAnaSRERECdhJEhERJWAnSURElICFO1RheTfzpylAue+++0zb3Llzo/iWW24xOT169Ijixx57zORUrVo1il999VWTs3HjRtPWqlWrKN57771NzqJFi6K4T58+JkevJqL3BwB+/OMfm7Zf//rXUTx27FiTo4uASnPlEKJdhVeSRERECdhJEhERJWAnSURElIBjklRh5XsD/KGHHmraGjduHMU9e/Y0OZdeemkUb9u2zeTom/nvuecek7Ns2TLT1qZNmyh+4oknTE7//v2j+LDDDjM5v/vd76J43bp1Jme//fYzbd4YqMYJB6gi4pUkERFRAnaSRERECdhJEhERJWAnSURElICFO1SpeTfOz5gxw7T95S9/ieKJEyeanN69e0fxgQceaHLuvvvuKH7qqadMzg033GDarrnmmij+5z//aXKee+65KP7hD39oct544w3Tpj300EOmrXr16lG8xx721PHtt9/m3DaVT2km3vAKurp27RrFzzzzTMnuWDnAK0kiIqIE7CSJiIgSsJMkIiJKwDFJqtSOPvpo09avXz/TtmrVqij2xiTPP//8KPYmGNdjkqtXrzY59evXN20HH3xwFHtjko8++mgUn3TSSSbn/fffj+JBgwaZnIMOOsi06YkKFixYYHImTZpk2qgwpJkI4h//+Idp27p1axQPHDjQ5FxxxRVRrD9LQP6LEZQGXkkSERElYCdJRESUgJ0kERFRAnaSRERECVi4Q5Xaq6++atq2bNli2o466qgoPv74402ObmvZsqXJOfLII6P4Zz/7Wc7tALbAyLvhXxdReM9j1qxZUdy0aVOT4xVM6BVNWKRT8V188cVR7BWZ6QkkunfvbnJeeeWVKPZWp/GOOV3M4+Xstlvu67zvvvsuZ05xeCVJRESUgJ0kERFRAnaSRERECdhJEhERJai0hTtpBoUbNGhg2lq0aBHFu7KAoaRWWijPs1mUtY4dO5q23/3ud6atVatWUTxmzBiTc95550XxIYccYnLefvvtKK5atarJqVu3rmnTK3x89tlnJueSSy6J4tmzZ5ucJUuWRPE777xjckaPHm3afvrTn0ZxrVq1TM7atWtNG+UvzTmqpNx4442m7YQTTojihQsXmhy9OsymTZtMjj7G9Wo5ADB27FjTlub57mxRThq8kiQiIkrATpKIiCgBO0kiIqIElWJM0rvhVH+Xrb9bB/ybuvfcc88obtOmjcnRN2x/+OGHee1jmvHHZs2ambavvvoqitN8t5/mptyKQN88r8faAGDevHmmbfHixVGsx2sAoG3btlG8//7759wfPUYJ2IkLgHTvjx4DXb9+vckZMmRIFP/whz80OQ888IBp02O3I0eONDmnn356zn2k9PTntqRqC4444gjT1qNHD9N2yy23RPGJJ55ocnTdxrp160zOvvvuG8U333yzyfnTn/5k2l544QXTplWrVi2Kveehxzu917E4lePMSERElAd2kkRERAnYSRIRESVgJ0lERJSg3BTu7OhganHyGczWBTmAX7jz1FNPRXHjxo1NTv/+/aO4X79+JmfEiBFR7N0U691UrosqunXrZnJeeumlKP7zn/9scrzilMpg0aJFUfzll1+aHK/gRq/W8cUXX5ic1q1bR/GBBx5ocvSqI8cdd5zJOf/8803bN998E8XeRAG6+KF58+Ym54Ybbohib0UGr02v7vCf//zH5FD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svcHUNNv53e9+F8XeqgLejPJ68NibhODCCy+M4l/96lcm54033nD3tainnnrKtF100UVRXL16dZPz0UcfRfGIESNMjh68Hjx4sMmpU6eOafvHP/4Rxd6K4npbU6dONTn5rGheEehiqBYtWpic3//+96ZNF+6MHz/e5EyfPj2KhwwZYnL0Z8ErNPDed11wNGbMGJOji4L+85//mBx9/Pz4xz82OWeccYZp06uXeBMVkE9/1ryiJ6+QMM1nsl+/flGsV3kBbCHjl19+aXJatWpl2nRRzoIFC0yOXnXDW82jS5cuUbz//vubHG+f9MpM+jMA2PNovXr1TM7O4pUkERFRAnaSRERECdhJEhERJWAnSURElKDYwh1vZYx8HHbYYaZt7dq1UezN8N69e3fTtnLlyigeOXKkyRk0aFAUv/766yZHz+bgrfihCzEAu3qHNxPKJ598EsXeihG6uGfgwIEm5+9//7tp04UfN998s8nxVnHQKkuhjnbllVdGsXeMe8UHL730UhSPHj0652N5740uHPJmVRowYIBpu/7663M+3oQJE6J4+fLlOX/HOzYfeeQR0/bpp59GsS7YAOyxmWY2mPJMF9h4BYhpzpH6s5bvZ08XjwG2yGrevHkmR68m1L59e5PjFQDqQpkNGzaYHL3qxqRJk0zOL37xiyju06ePyfnrX/9q2nSf8NVXX5kczXs/2rVrF8UzZ87MuZ2ieCVJRESUgJ0kERFRAnaSRERECXZ4FZAOHTpEsXfzpl7R+rjjjjM5+kZnb9zS+w5cr8zhfQd91113RfHJJ59scvTKIN739HpVB8DevKrHNgE7FuPdqKsnT9ATIAD+eNF9990XxWeeeabJ0c9NryoP2FVIlixZYnIqombNmkWx975fd911pk2Pa3iru+ubpq+++mqT8+ijj0axN+49Y8YM09a5c+co9lYhue2226LYG5PU7/uxxx5rcryxn2OOOSaKDz/8cJOjPy+zZ882OYVEjx2WVI2GXkkIAFq3bm3a9LHqncc+++yzKO7atWvO7XjnA+8cpZ+/typT7969o7h///4m56abbopifSwBQMeOHU2bHq/XY6uArSXRq0sBdsIOjkkSERGVEHaSRERECdhJEhERJWAnSUREl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lKlimnbsmVLGexJySuL447nusqtuGOOV5JEREQJ2EkSERElYCdJRESUgJ0kERFRgoJcKZqopHhFOrvvvrtp27ZtW85tfe9734viI444wuS0bds2inVBEADMnDnTtF111VVRXFGKdIjKO15JEhERJWAnSURElICdJBERUQKOSVKllu/443XXXWfaTjzxxCieMmWKydHjlp5///vfpm3y5MlR/Otf/9rkjBo1Koq98c6yngSBqNDwSpKIiCgBO0kiIqIE7CSJiIgSsJMkIiJKUOyiy5wZv2Sceuqppu35558v9f0oKs2qFpVhFZCqVauatm+++ca0XX/99VHcrl07k7PnnntG8ZlnnpnXPp199tmm7dhjj43i6tWrm5xrr702iqdPn25y9D5u3bo1n13cpbgKCJU2rgJCRESUB3aSRERECdhJEhERJeCYZDHSrlqv9ezZM4rfeecdk3PfffdF8aOPPmpyVqxYYdrWrl1bbAyU3A3jhT4mqcffADt5wNdff51qW7NmzYriTZs2mZzZs2dH8SmnnGJy9tgjnr/j22+/zZkDAOPHj4/ihg0bmpy33347ii+44AKTo3mTKXjHvZ5gIc3nIF8ck6TSxjFJIiKiPLCTJCIiSsBOkoiIKAE7SSIiogQs3NlJI0aMMG36xu8lS5aYnKZNm0ZxtWrVTI733uhCE6+AZK+99opi76byN954I4p1IVH28Qu6cCdfl1xyiWm78847o9hbKWTAgAFRrAtpdsa7774bxb169TI5y5Yti+JmzZqZnDQrnKSRb1FbGizcodLGwh0iIqI8sJMkIiJKwE6SiIgogb1ruZJKu0K9Hos58sgjTc6qVaui2Ls5fOnSpVFcs2ZNk+PdDK8f3xvL1M+lU6dOJufQQw+NYm9ss9DpMULATtDw8ccfm5zOnTvn3LY30UNJjkFqv/3tb6N41KhRJmffffeN4iuvvNLk3HrrrTkfa++99zZtmzdvjmJv/FEfm7tywgEqfd5YfZMmTaL4kUceMTn63DJ//vwS2yd9zKUZK9/R45JXkkRERAnYSRIRESVgJ0lERJSAnSQREVECFu7soH79+kXxbrvZvzP0Df/65n7v97zVKNKs5uHl6IIjbzB7+fLlUaxX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jPmBvmG7QoIHJ0RMFeJMJ6Ami9SrkO0NP1uu9xvr5epPA65XJAXvDujehsJ703JsEXb9G3oTZIQQ763ApyPe4a9myZbExABxwwAFRfOyxx5ocbxICPbHG3LlzTY4et/QmBdCTVvTv39/k3HPPPaZNH+dnnHGGyWnatGkUP/744ybn448/LvZ3vBwAuPHGG6PYG8s8/fTTTVs+yuK4K81zHZU/xR1zvJIkIiJKwE6SiIgoATtJIiKiBOwkiYiIEpSbwh0qfwqtcKd3795RPHbsWJOjC6a8whk90QIAvPjii1HsrXjRokWLKG7Xrp3JOeKII6J4zpw5Jmf+/Pk5t+1NfjFr1qwo9laA1wVAEyZMMDleUU6vXr2i+I9//KPJKSks3KHSxsIdIiKiPLCTJCIiSsBOkoiIKAHHJClRoY1J6kkjvEnb9QT5ffr0MTn9+vUzbcuWLYvid9991+ToyQSaN29ucsaNGxfFixYtMjneDf7169fPmaPHG/X+eI/3+eefm5wlS5aYtjTSTKKRBsckqbRxTJKIiCgP7CSJiIgSsJMkIiJKwE6SiIgoQbGFO0RERJUZrySJiIgSsJMkIiJKwE6SiIgoATtJIiKiBOwkiYiIErCTJCIiSvD/ARV5KPDNON6wAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 576x576 with 9 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "'''\n",
    "迭代和可视化数据集\n",
    "我们可以索引Datasets手动喜欢的列表：training_data[index]。我们matplotlib用来可视化训练数据中的一些样本。\n",
    "'''\n",
    "\n",
    "labels_map = {\n",
    "    0: \"T-Shirt\",\n",
    "    1: \"Trouser\",\n",
    "    2: \"Pullover\",\n",
    "    3: \"Dress\",\n",
    "    4: \"Coat\",\n",
    "    5: \"Sandal\",\n",
    "    6: \"Shirt\",\n",
    "    7: \"Sneaker\",\n",
    "    8: \"Bag\",\n",
    "    9: \"Ankle Boot\",\n",
    "}\n",
    "figure = plt.figure(figsize=(8, 8))\n",
    "cols, rows = 3, 3\n",
    "for i in range(1, cols * rows + 1):\n",
    "    sample_idx = torch.randint(len(training_data), size=(1,)).item()\n",
    "    img, label = training_data[sample_idx]\n",
    "    figure.add_subplot(rows, cols, i)\n",
    "    plt.title(labels_map[label])\n",
    "    plt.axis(\"off\")\n",
    "    plt.imshow(img.squeeze(), cmap=\"gray\")\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "a1ecdaca",
   "metadata": {},
   "outputs": [
    {
     "ename": "ImportError",
     "evalue": "cannot import name 'read_image'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mImportError\u001b[0m                               Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-11-7c325258dc3e>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m      6\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mos\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      7\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mpandas\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0mpd\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 8\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[0mtorchvision\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mio\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mread_image\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      9\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     10\u001b[0m \u001b[1;32mclass\u001b[0m \u001b[0mCustomImageDataset\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mDataset\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mImportError\u001b[0m: cannot import name 'read_image'"
     ]
    }
   ],
   "source": [
    "'''\n",
    "为您的文件创建自定义数据集\n",
    "自定义 Dataset 类必须实现三个函数：__init__、__len__和__getitem__。看看这个实现；FashionMNIST 图像存储在一个目录中img_dir，它们的标签单独存储在一个 CSV 文件中annotations_file。\n",
    "在接下来的部分中，我们将分解每个函数中发生的事情。\n",
    "'''\n",
    "import os\n",
    "import pandas as pd\n",
    "from torchvision.io import read_image\n",
    "\n",
    "class CustomImageDataset(Dataset):\n",
    "# __init__ 函数在实例化 Dataset 对象时运行一次。我们初始化包含图像、注释文件和两个转换的目录（下一节将详细介绍）。\n",
    "    def __init__(self, annotations_file, img_dir, transform=None, target_transform=None):\n",
    "        self.img_labels = pd.read_csv(annotations_file)\n",
    "        self.img_dir = img_dir\n",
    "        self.transform = transform\n",
    "        self.target_transform = target_transform\n",
    "    def __len__(self):\n",
    "        return len(self.img_labels)\n",
    "    def __len__(self, idx):\n",
    "        img_path = os.path.join(self.img_dir, self.img_labels.iloc[idx, 0])\n",
    "        image = read_image(img_path)\n",
    "        label = self.img_labels.iloc[idx, 1]\n",
    "        if self.transform:\n",
    "            image = self.transform(image)\n",
    "        if self.target_transform:\n",
    "            label = self.target_transform(label)\n",
    "        return image, label\n",
    "'''\n",
    "label.csv 文件如下所示：\n",
    "\n",
    "tshirt1.jpg, 0\n",
    "tshirt2.jpg, 0\n",
    "......\n",
    "ankleboot999.jpg, 9\n",
    "'''\n",
    "# __len__ 函数返回我们数据集中的样本数\n",
    "\n",
    "'''\n",
    "__getitem__ 函数从给定索引处的数据集中加载并返回一个样本idx。基于索引，它识别图像在磁盘上的位置，使用将其转换为张量read_image，\n",
    "从 中的 csv 数据中检索相应的标签self.img_labels，调用它们的变换函数（如果适用），并返回张量图像和相应的标签一个元组。\n",
    "'''\n",
    "#报错了，估计是torchvision版本问题没有包含read_image函数 本地torchvision版本是0.40 torch==1.2.0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "d37e130b",
   "metadata": {},
   "outputs": [],
   "source": [
    "'''\n",
    "准备数据以使用 DataLoaders 进行训练\n",
    "该Dataset检索我们的数据的功能，并在同一时间标签一个样本。在训练模型时，我们通常希望以“小批量”形式传递样本，\n",
    "在每个时期重新洗牌数据以减少模型过度拟合，并使用 Pythonmultiprocessing来加速数据检索。\n",
    "DataLoader 是一个迭代器，它在一个简单的 API 中为我们抽象了这种复杂性。\n",
    "'''\n",
    "from torch.utils.data import DataLoader\n",
    "\n",
    "train_dataloader = DataLoader(training_data, batch_size=64, shuffle=True)\n",
    "test_dataloader = DataLoader(test_data, batch_size=64, shuffle=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "0dacbed7",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Feature batch shape: torch.Size([64, 1, 28, 28])\n",
      "Labels batch shape: torch.Size([64])\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD4CAYAAAAq5pAIAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAQnElEQVR4nO3daYhddZrH8d+TfY9ZSBkXTE8IhFYw3UYZmDA4aWwzvlBboe28kIxLYqCD3SLSknnR4jAgg93zwhdCROmMZIyNC0oI3XFC1BGhsZRo4tJZNNqV1Swm0SyV5ZkXddJTrXWef3nPvfdc8/9+IFTVferc+69b9cs59z7nf/7m7gJw/htS9wAAtAdhBzJB2IFMEHYgE4QdyMSwdj6YmfHWP9Bi7m4D3V5pz25mC8zsz2a2zcwerHJfAFrLGu2zm9lQSVskXSepR9Jbkha6+wfBNuzZgRZrxZ79Gknb3P1jd++VtFrSTRXuD0ALVQn7xZL+0u/rnuK2v2FmS8ys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ZIKwA5kg7EAmCDuQCcIOZIKwA5kg7EAmCDuQCcIOZIKwA5kg7EAmCDuQieQFJ5tsv6RP+309tbitE3Xq2Dp1XBJja1Qzx3ZZWaGt89m/8eBm3e4+t7YBBDp1bJ06LomxNapdY+MwHsgEYQcyUXfYV9T8+JFOHVunjktibI1qy9hqfc0OoH3q3rMDaBPCDmSilrCb2QIz+7OZbTOzB+sYQxkz22Fmm4plqGtdn65YQ2+fmW3ud9tkM3vFzLYWHwdcY6+msXXEMt7BMuO1Pnd1L3/e9tfsZjZU0hZJ10nqkfSWpIXu/kFbB1LCzHZImuvutZ+AYWb/KOlLSf91bmktM/sPSQfd/ZHiP8pJ7v6rDhnbQ/qWy3i3aGxly4z/i2p87pq5/Hkj6tizXyNpm7t/7O69klZLuqmGcXQ8d39d0sGv3XyTpJXF5yvV98fSdiVj6wjuvtvd3yk+Pyrp3DLjtT53wbjaoo6wXyzpL/2+7lFnrffuktaZ2dtmtqTuwQygq98yW3skddU5mAEkl/Fup68tM94xz10jy59XxRt03zTP3X8o6Z8l/bw4XO1I3vcarJN6p49Lmqm+NQB3S/pNnYMplhl/XtIv3f1I/1qdz90A42rL81ZH2HdKurTf15cUt3UEd99ZfNwn6UX1vezoJHvPraBbfNxX83j+yt33uvsZdz8r6QnV+NwVy4w/L2mVu79Q3Fz7czfQuNr1vNUR9rckzTKz75nZCEk/k/RyDeP4BjMbW7xxIjMbK+nH6rylqF+WtKj4fJGkl2ocy9/olGW8y5YZV83PXe3Ln7t72/9JukF978hvl/SvdYyhZFx/J+nd4t/7dY9N0jPqO6w7pb73Nu6SNEXSeklbJf2PpMkdNLan1be093vqC9b0msY2T32H6O9J2lj8u6Hu5y4YV1ueN06XBTLBG3RAJgg7kAnCDmSCsAOZIOxAJgg7kAnCDmTi/wCB+4qROwXq/QAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Label: 9\n"
     ]
    }
   ],
   "source": [
    "'''\n",
    "遍历 DataLoader\n",
    "我们已将该数据集加载到Dataloader中，Dataloader并且可以根据需要遍历数据集。\n",
    "下面的每次迭代都会返回一批train_features和train_labels（batch_size=64分别包含特征和标签）。\n",
    "因为我们指定了shuffle=True，在我们遍历所有批次后，数据会被打乱（为了对数据加载顺序进行更细粒度的控制，请查看Samplers）。\n",
    "'''\n",
    "# Display image and label.\n",
    "train_features, train_labels = next(iter(train_dataloader))\n",
    "#Python中next()函数、iter()以及next(iter())函数的用法详解 https://blog.csdn.net/weixin_42782150/article/details/109315355\n",
    "print(f\"Feature batch shape: {train_features.size()}\")\n",
    "print(f\"Labels batch shape: {train_labels.size()}\")\n",
    "img = train_features[0].squeeze()\n",
    "label = train_labels[0]\n",
    "plt.imshow(img, cmap=\"gray\")\n",
    "plt.show()\n",
    "print(f\"Label: {label}\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ce847fdd",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
